'''
Created on Oct 9, 2012

@author: Himanshu
'''

class gestureSet():
    '''
    classdocs
    '''


    def __init__(self):
        '''
        Constructor
        '''
        self.noGestures = 0
        self.gestures = {}
        self.gestureNames = {}
    
    def addGesture(self, gesture):
        self.gestures[gesture.getGestureName()] = gesture
        self.noGestures += 1
        
    def returnGestureSet(self):
        return self.gestures
    
    def returnNoGestures(self):
        return self.noGestures
    
    def removeGesture(self, gestureName):
        k = self.gestures.pop(gestureName, 0)
        if (k != 0):
            return k
        else: 
            print "No such gesture " + gestureName
            return 
    
    def hasGesture(self, gestureName):
        return self.gestures.has_key(gestureName)
    
class gesture():
    """
    classdocs
    """
    
    def __init__(self, instances, gestureName):
        """
        Constructor
        """
        self.noInstances = instances.__len__()
        self.instances = instances
        self.name = gestureName
        self.score = None
        
    
    def getGestureName(self):
        return self.name
    
    def returnNoInstances(self):
        return self.noInstances
    
    def returnInstances(self):
        return self.instances
        
    def addInstances(self, additionalList):
        for i in additionalList:
            self.instances.append(i)
            self.noInstances += 1
        
    def setScore(self, score):
        self.score = score
        
    def returnScore(self):
        return self.score
        
        
        
        
        
        
        
        
        
        
        
        